﻿<dxlc:LayoutControl
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
        xmlns:dxm="http://schemas.devexpress.com/winfx/2008/xaml/map"
    xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
    x:Class="Luna.UI.Crm.EntityEditView"
    xmlns:lunac="clr-namespace:Luna.UI.Converters"
             mc:Ignorable="d"
            Orientation="Vertical" UseLayoutRounding="True" View="GroupBox"
    HorizontalAlignment="Stretch" VerticalAlignment="Stretch" d:DesignWidth="722">
    <dxlc:LayoutControl.Resources>
        <Style TargetType="dxlc:LayoutItem">
            <Setter Property="Margin" Value="5" />
        </Style>
        <Style TargetType="dxlc:LayoutGroup">
            <Setter Property="Margin" Value="10" />
        </Style>
        <lunac:PhoneNumberConverter x:Key="PhoneConverter" />
    </dxlc:LayoutControl.Resources>
    <dxlc:LayoutGroup Orientation="Vertical" VerticalAlignment="Top" ItemLabelsAlignment="Local">
        <dxlc:LayoutGroup.Resources>
            <Style TargetType="dxlc:LayoutItem">
                <Setter Property="Margin" Value="5" />
                <Setter Property="FontWeight" Value="Bold" />
                <Setter Property="AddColonToLabel" Value="True" />
            </Style>
            <Style TargetType="TextBlock">
                <Setter Property="FontWeight" Value="Normal" />
                <Setter Property="Margin" Value="10,0,0,0" />
            </Style>
        </dxlc:LayoutGroup.Resources>
        <dxlc:LayoutItem>
            <WrapPanel>
                <TextBlock Foreground="#FFF78A09" FontWeight="Bold" Text="{Binding Entity.FullName}" FontSize="16" VerticalAlignment="Center" FontStyle="Italic" />
                <TextBlock Text=" . " VerticalAlignment="Center" />
                <TextBlock Text="{Binding Entity.Company}" FontStyle="Italic" FontSize="13" VerticalAlignment="Center" />
            </WrapPanel>
        </dxlc:LayoutItem>
        <dxlc:LayoutItem Label="Gestionnaire">
        </dxlc:LayoutItem>
        <dxlc:LayoutItem FontWeight="Bold" Label="Adresse e-mail">
            <TextBlock Text="{Binding Entity.Mail}" />
        </dxlc:LayoutItem>
        <dxlc:LayoutItem FontWeight="Bold" Label="Téléphone">
            <TextBlock  Text="{Binding Entity.Phone, Converter={StaticResource PhoneConverter}}" />
        </dxlc:LayoutItem>
        <dxlc:LayoutItem FontWeight="Bold" Label="Portable">
            <TextBlock Text="{Binding Entity.Mobile, Converter={StaticResource PhoneConverter}}" />
        </dxlc:LayoutItem>
        <dxlc:LayoutItem Label="Statut" ></dxlc:LayoutItem>
    </dxlc:LayoutGroup>

    <dxlc:LayoutGroup  View="Tabs">
        <dxlc:LayoutGroup Header="General" Orientation="Vertical" HorizontalAlignment="Stretch">
            <dxm:MapControl CenterPoint="{Binding CenterPoint}" ZoomLevel="11" Margin="5">
                <dxm:ImageTilesLayer>
                    <dxm:ImageTilesLayer.DataProvider>
                        <dxm:OpenStreetMapDataProvider Kind="Hybrid" />
                    </dxm:ImageTilesLayer.DataProvider>
                </dxm:ImageTilesLayer>
                <dxm:VectorLayer>
                    <dxm:MapPushpin Information="{Binding Entity.FullName}" Brush="Red" Location="{Binding CenterPoint}" />
                </dxm:VectorLayer>
            </dxm:MapControl>
        </dxlc:LayoutGroup>
        <dxlc:LayoutGroup Header="Informations" Orientation="Vertical" HorizontalAlignment="Stretch">
            <dxlc:LayoutGroup  Orientation="Horizontal" HorizontalAlignment="Stretch">
                <dxlc:LayoutGroup Orientation="Vertical" VerticalAlignment="Top">
                    <dxlc:LayoutItem Label="Titre">
                        <dxe:ComboBoxEdit EditValue="{Binding Entity.Title}" AllowNullInput="True">
                            <dxe:ComboBoxEditItem Content="M."  Stylus.IsFlicksEnabled="False" />
                            <dxe:ComboBoxEditItem Content="Mme"  Stylus.IsFlicksEnabled="False" />
                            <dxe:ComboBoxEditItem Content="Mlle" Stylus.IsFlicksEnabled="False" />
                        </dxe:ComboBoxEdit>
                    </dxlc:LayoutItem>
                    <dxlc:LayoutItem Label="Nom">
                        <dxe:TextEdit EditValue="{Binding Entity.Name}" />
                    </dxlc:LayoutItem>
                    <dxlc:LayoutItem Label="Prénom">
                        <dxe:TextEdit  EditValue="{Binding Entity.Surname}" />
                    </dxlc:LayoutItem>
                    <dxlc:LayoutItem Label="Société">
                        <dxe:TextEdit EditValue="{Binding Entity.Company}" />
                    </dxlc:LayoutItem>
                    <dxlc:LayoutItem Label="Téléphone">
                        <dxe:TextEdit  EditValue="{Binding Entity.Phone, Converter={StaticResource PhoneConverter}}" />
                    </dxlc:LayoutItem>
                    <dxlc:LayoutItem Label="Portable">
                        <dxe:TextEdit  EditValue="{Binding Entity.Mobile, Converter={StaticResource PhoneConverter}}" />
                    </dxlc:LayoutItem>
                    <dxlc:LayoutItem Label="Origine">
                        <dxe:TextEdit  EditValue="{Binding Entity.Source}" />
                    </dxlc:LayoutItem>
                    <dxlc:LayoutItem Label="Gestionnaire">
                        <dxe:TextEdit  EditValue="{Binding Entity.Manager}" />
                    </dxlc:LayoutItem>
                </dxlc:LayoutGroup>
                <dxlc:LayoutGroup Orientation="Vertical" VerticalAlignment="Top">
                    <dxlc:LayoutItem Label="Secteur d'activité">
                        <dxe:TextEdit EditValue="{Binding Entity.Sector}" />
                    </dxlc:LayoutItem>
                    <dxlc:LayoutItem Label="URL du site web">
                        <dxe:TextEdit EditValue="{Binding Entity.Url}" />
                    </dxlc:LayoutItem>
                    <dxlc:LayoutItem Label="Adresse e-mail">
                        <dxe:TextEdit  EditValue="{Binding Entity.Mail}" />
                    </dxlc:LayoutItem>
                    <dxlc:LayoutItem Label="Email secondaire">
                        <dxe:TextEdit />
                    </dxlc:LayoutItem>
                    <dxlc:LayoutItem Label="Télécopie">
                        <dxe:TextEdit EditValue="{Binding Entity.Fax}" />
                    </dxlc:LayoutItem>
                    <dxlc:LayoutItem Label="Identifiant skype">
                        <dxe:TextEdit EditValue="{Binding Entity.Skype}" />
                    </dxlc:LayoutItem>
                    <dxlc:LayoutItem Label="Twitter">
                        <dxe:TextEdit EditValue="{Binding Entity.Twitter}" />
                    </dxlc:LayoutItem>
                    <dxlc:LayoutItem Label="Rejet des mails">
                        <dxe:CheckEdit EditValue="{Binding Entity.NoMail}" />
                    </dxlc:LayoutItem>
                </dxlc:LayoutGroup>
                <dxlc:LayoutGroup Orientation="Vertical">
                    <dxlc:LayoutItem Label="Adresse">
                        <dxe:TextEdit EditValue="{Binding Entity.Adress}" />
                    </dxlc:LayoutItem>
                    <dxlc:LayoutItem Label="Code postal">
                        <dxe:TextEdit EditValue="{Binding Entity.ZipCode}" />
                    </dxlc:LayoutItem>
                    <dxlc:LayoutItem Label="Ville">
                        <dxe:TextEdit EditValue="{Binding Entity.City}" />
                    </dxlc:LayoutItem>
                    <dxlc:LayoutItem Label="Pays">
                        <dxe:TextEdit EditValue="{Binding Entity.Country}" />
                    </dxlc:LayoutItem>
                </dxlc:LayoutGroup>
            </dxlc:LayoutGroup>

            <dxlc:LayoutGroup Header="Description" View="GroupBox" Orientation="Vertical"  VerticalAlignment="Stretch">
                <dxlc:LayoutItem VerticalAlignment="Stretch">
                    <dxe:TextEdit TextWrapping="Wrap"
                  AcceptsReturn="True"
                  AcceptsTab="True"
                  VerticalContentAlignment="Top"
                  VerticalAlignment="Stretch"
                  EditValue="{Binding Entity.Description}" />
                </dxlc:LayoutItem>
            </dxlc:LayoutGroup>
        </dxlc:LayoutGroup>

        <dxlc:LayoutGroup Header="Mail" Orientation="Vertical" HorizontalAlignment="Stretch">
        </dxlc:LayoutGroup>
    </dxlc:LayoutGroup>
</dxlc:LayoutControl>